home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr27 / gs26.zip / PCHARSTR.PS < prev    next >
Text File  |  1993-01-26  |  2KB  |  69 lines

  1. %    Copyright (C) 1990, 1992 Aladdin Enterprises.  All rights reserved.
  2. %    Distributed by Free Software Foundation, Inc.
  3. %
  4. % This file is part of Ghostscript.
  5. %
  6. % Ghostscript is distributed in the hope that it will be useful, but
  7. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. % to anyone for the consequences of using it or for whether it serves any
  9. % particular purpose or works at all, unless he says so in writing.  Refer
  10. % to the Ghostscript General Public License for full details.
  11. %
  12. % Everyone is granted permission to copy, modify and redistribute
  13. % Ghostscript, but only under the conditions described in the Ghostscript
  14. % General Public License.  A copy of this license is supposed to have been
  15. % given to you along with Ghostscript so you can know your rights and
  16. % responsibilities.  It should be in a file named COPYING.  Among other
  17. % things, the copyright notice and this notice must be preserved on all
  18. % copies.
  19.  
  20. % pcharstr.ps
  21. % Print the CharStrings and Subrs (if present) from a Type 1 font,
  22. % in symbolic form.
  23.  
  24. % Load the Type 1 utilities.
  25. (type1ops.ps) run
  26.  
  27. /printcs
  28.  { dup type /stringtype eq
  29.     { printcs1 (\n) print }
  30.     { ( ) print == }
  31.    ifelse
  32.  } bind def
  33. /printcs1
  34.  { 4330 exch dup length string type1decrypt exch pop
  35.    dup length lenIV sub lenIV exch getinterval
  36.    save exch 0 () /SubFileDecode filter
  37.    mark exch charstack_read
  38.    counttomark 1 sub -1 0
  39.     { index ( ) print ==only
  40.     }
  41.    for cleartomark restore
  42.  } bind def
  43.  
  44. /printfont
  45.  { currentfont begin Private begin 10 dict begin
  46.    gsave nulldevice FontMatrix matrix invertmatrix concat
  47.    0 1 Encoding length 1 sub
  48.     { dup Encoding exch get dup /.notdef eq
  49.        { pop pop
  50.        }
  51.        { 1 index =only ( ) print ==only ( ) print
  52.          ( ) dup 0 4 -1 roll put
  53.          newpath 0 0 moveto false charpath
  54.      [ pathbbox ] ==
  55.        }
  56.       ifelse
  57.     } for
  58.    grestore
  59.    CharStrings { exch ==only printcs } forall
  60.    /Subrs where
  61.     { pop    % the dictionary
  62.       0 1 Subrs length 1 sub
  63.        { dup =only
  64.          Subrs exch get printcs
  65.        } for
  66.     } if
  67.    end end end
  68.  } bind def
  69.